import { ORDER_ITEM_TYPE_ENUMS, ORDER_STATUS, SHIPMENT_STATUS_ENUM } from '@CONSTANTS/order'
import { ServicePackITF } from '@INTERFACES/ServicePackITF'
import { CustomI18NITF } from '@INTERFACES/Common'
import { PlanManagementITF } from '@INTERFACES/PlanManagement'
import { ShipAddressITF } from '@INTERFACES/Address'

export interface PatronITF {
  Name: CustomI18NITF
  SearchName: string
  UserId: string
  UserName: string
}

export interface ItemInfoITF {
  Cost: number
  CostUnit: string
  ItemId: string
}

export interface ShipmentItemITF {
  GoodsName: CustomI18NITF
  PreviewFileName: string
  Quantity: number
  CustomerName: string
  GoodsSKU: string
  LogisticCode: string
  ShipperCode: string
  ShipperName: string
  State: SHIPMENT_STATUS_ENUM
}

export interface TraceITF {
  Action: string
  AcceptStation: string
  AcceptTime: string
  Location: string
}

export interface ParcelStateITF {
  LogisticCode: string
  ShipperCode: string
  State: string
  StateEx: string
  Traces: TraceITF[]
}

export interface OrderDetailITF {
  p8Id: string
  Balance: number
  TotalCost: number
  DiscountAmount: number
  CreatedDate: number
  CanRating: boolean
  ItemNumber: number
  ItemType: ORDER_ITEM_TYPE_ENUMS
  Status: ORDER_STATUS
  OrderId: string
  OrderSerialNumber: string
  ServicePack: ServicePackITF
  PainManagement: PlanManagementITF
  FriendlyId: string
  ItemInfo: ItemInfoITF
  ModifiedDate: number
  PaidAmount: number
  Patron: PatronITF
  PaymentStatus: string
  Renewed: boolean
  ShipmentStatus?: SHIPMENT_STATUS_ENUM
  ShipmentList?: ShipmentItemITF[]
  Address?: ShipAddressITF
  ShipmentState?: SHIPMENT_STATUS_ENUM
}

export interface OnBehalfOrderDetailITF {
  PainManagementId: string
  Title: CustomI18NITF
  Description: CustomI18NITF
  OriginalPrice: number,
  Duration: number,
  ManagementStataus: string,
  UserDisplayName: CustomI18NITF,
  OrderId: string,
  UserId: string,
  OrderStatus: string,
  PaymentStatus: string,
  CreatedDate: number
}
export interface OrderTimeLineOption {
  title: string
  status: ORDER_STATUS
  desc?: string
  btnText?: string
  btnClick?: () => void
  btnText2?: string
  btnClick2?: () => void
}

export type ServicePackCardColorITF = {
  [key in string ]: {
    lineColor: string
    statusColor: string
    statusText: string
  }
}
export interface OrderHeaderOptions {
  btnText?: string
  btnText1?: string
  btnText2?: string
  onClickBtn?: () => void
  onClickBtn1?: () => void
  onClickBtn2?: () => void
  total?: number
  isOneBtn?: boolean
  showBtn?: boolean
}
export interface PaymentITF{
  MwebUrl: string
  PaymentId: string
  return_code: number
  retmsg: string
  return_msg: string
  UseWeChatSandBox: boolean
  appId: string
  timeStamp: string
  nonceStr: string
  package: string
  signType: 'MD5' | 'HMAC-SHA256'
  paySign: string
}
export type PlanIconITF = {
  [key in string ]: {
    iconOrder: string
    iconList: string
  }
}
